#include "public.h"
#include "smg.h"
void smg_display(unsigned char dat[],unsigned char pos)
{
	int arr[17] = {0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
	int i = 0;
    unsigned char pos_temp = pos - 1;
	for(i=0;i<8;i++)
	{	
		switch(i)
		{
			 case 0:
			 wmC = 1;wmB = 1; wmA = 1;DM = arr[0];break;
			 case 1:
			 wmC = 1;wmB = 1; wmA = 0;DM = arr[1];break;
			 case 2:
			 wmC = 1;wmB = 0; wmA = 1;DM = arr[2];break;
			 case 3:
			 wmC = 1;wmB = 0; wmA = 0;DM = arr[3];break;
			 case 4:
			 wmC = 0;wmB = 1; wmA = 1;DM = arr[4];break;
			 case 5:
			 wmC = 0;wmB = 1; wmA = 0;DM = arr[5];break;
			 case 6:
			 wmC = 0;wmB = 0; wmA = 1;DM = arr[6];break;
			 case 7:
			 wmC = 0;wmB = 0; wmA = 0;DM = arr[7];break;	
		}
        DM = arr[dat[i-pos_temp]];
		delay_10us(50);
        DM = 0x00;
	}	
}
